#include <iostream>
// 需要和34MultiFilesDefineVariables2.cpp一起编译

using namespace std;

// 外部变量
extern double warming = 0.3;
// 编译器将会给出警告
// .\34MultiFilesDefineVariables1.cpp:7:15: warning: 'warming' initialized and declared 'extern'
//  extern double warming = 0.3;
//                ^~~~~~~

// 函数原型
void update(double dt);
void local();

int main()
{
    cout << "Global warming is " << warming << endl;
    update(0.1);
    cout << "Global warming is " << warming << endl;
    local();
    cout << "Global warming is " << warming << endl;

    // Global warming is 0.3
    // Updating global warming to:0.4
    // Global warming is 0.4
    // Local warming = 0.8
    // But Global warming is = 0.4
    // Global warming is 0.4
    return 0;
}